<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_', '-', osc_current_user_locale()); ?>">
    <head>
        <?php osc_current_web_theme_path('head.php') ; ?>
        <meta name="robots" content="index, follow" />
        <meta name="googlebot" content="index, follow" />
    </head>
    <body>
        <?php osc_current_web_theme_path('header.php') ; ?>
        <div id="form_publish">
            <?php osc_current_web_theme_path('inc.search.php') ; ?>
        </div>
        <div class="content home">
            <div id="main">
                <?php
                    $total_categories   = osc_count_categories() ;
                    $col1_max_cat       = ceil($total_categories/3);
                    $col2_max_cat       = ceil(($total_categories-$col1_max_cat)/2);
                    $col3_max_cat       = $total_categories-($col1_max_cat+$col2_max_cat);
                ?>
                <div class="categories <?php echo 'c' . $total_categories ; ?>">
                    <?php osc_goto_first_category() ; ?>
                    <?php
                        $i      = 1;
                        $x      = 1;
                        $col    = 1;
                        if(osc_count_categories () > 0) {
                            echo '<div class="col c1">';
                        }
                    ?>
                  
                    <?php $count=1; ?>
                    <?php while ( osc_has_categories() ) { ?>
                        <div class="sub color1" >
							<p>
							<span style="z-index: 11;" class="drdopen dis0">
							<span class="drdtop"></span>
							<span class="drdmid">
                        
                            <?php if ( osc_count_subcategories() > 0 ) { ?>                            
                                    <?php while ( osc_has_subcategories() ) { ?>                                      
                                        <a class="<?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>">
                                        <?php echo osc_category_name() ; ?></a>                                       
                                    <?php } ?>
                             
                            <?php } ?>
						
							</span>

							</span>
							</p>
							<span class="main">
							<a class="<?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>">
                            <?php echo osc_category_name() ; ?></a>
                            <span style=" " class="drd">
                            </span>
							</span>
                        </div>
                        <?php
                            if (($col==1 && $i==$col1_max_cat) || ($col==2 && $i==$col2_max_cat) || ($col==3 && $i==$col3_max_cat)) {
                                $i = 1;
                                $col++;
                                
                            $totCat=$col2_max_cat-$col3_max_cat;
                            if($totCat>0 && $count==$total_categories){
                            for($i=1; $i<=$totCat; $i++)
                            {
                        			echo "<div class='sub color1'><p><span style='z-index: 11;' class='drdopen dis0'><span class='drdtop'></span><span class='drdmid'></span></span></p>";
                        			echo "<span class='main'><a class='community' href='' style=''>Many More..</a><span  ></span></span></div>";
									//echo '</div>';
                            }
                            }
                                echo '</div>';
                                if($x < $total_categories) {
                                    echo '<div class="col c'.$col.'">';
                                }
                            } else {
                                $i++ ;
                            }
                            $x++ ;
                        ?>
                    <?php $count++;} ?>
               </div>
              <div class="latest_ads">
                   <h1><strong><?php _e('Latest Listings', 'modern') ; ?></strong></h1>
                    <?php if( osc_count_latest_items() == 0) { ?>
                        <p class="empty"><?php _e('No Latest Listings', 'modern') ; ?></p>
                    <?php } else { ?>
                        <table border="0" cellspacing="0">
                             <tbody>
                                <?php $class = "even"; ?>
                                <?php while ( osc_has_latest_items() ) { ?>
                                 <tr class="latestAdsRow <?php echo $class. (osc_item_is_premium()?" premium":"") ; ?>" style="border:1px solid #f3f3f3; ">
                                        <?php if( osc_images_enabled_at_items() ) { ?>
										<td style=" padding-left:8px;">
											<span class="photo"  style="float:left; height:60px; width:80px;" >
                                            <?php if( osc_count_item_resources() ) { ?>
                                                <a href="<?php echo osc_item_url() ; ?>">
                                                    <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" />
                                                </a>
                                            <?php } else { ?>
                                                <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title="" />
                                            <?php } ?></span>
                                        <?php } ?><span class="text" style="float:left; height:auto; width:auto;" >	
                                             <h3><a href="<?php echo osc_item_url() ; ?>"><?php echo osc_item_title() ; ?></a></h3>
                                             <p><strong><?php if( osc_price_enabled_at_items() ) { echo osc_item_formated_price() ; ?> - <?php } echo osc_item_city(); ?> (<?php echo osc_item_region();?>) - <?php echo osc_format_date(osc_item_pub_date()); ?></strong></p>
                                             <p><?php echo osc_highlight( strip_tags( osc_item_description() ) ) ; ?></p>
                                         </span>
										</td>                                       
                                     </tr>
                                    <?php $class = ($class == 'even') ? 'odd' : 'even' ; ?>
                                <?php } ?>
                            </tbody>
                        </table>
                        <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
                        <p class='pagination'><?php echo osc_search_pagination(); ?></p>
                            <p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers", 'modern'); ?> &raquo;</strong></a></p>
                        <?php } ?>
                    <?php View::newInstance()->_erase('items') ; } ?>
                </div>
            </div>
            <div id="sidebar">
                <div class="navigation">
                    <?php if(osc_count_list_regions() > 0 ) { ?>
                    <div class="box location">
                        <h3><strong><?php _e("Location", 'modern') ; ?></strong></h3>
                        <ul>
                        <?php while(osc_has_list_regions() ) { ?>
                            <li><a href="<?php echo osc_list_region_url() ; ?>"><?php echo osc_list_region_name() ; ?></a> <em>(<?php echo osc_list_region_items() ; ?>)</em></li>
                        <?php } ?>
                        </ul>
                    </div>
                    <?php } ?>
                </div>
            </div>
        </div>
        <?php osc_current_web_theme_path('footer.php') ; ?>
        
        <script type="text/javascript">
       /* $(document).ready(function() {
            $('.catList').stop(true).hide();
                         
            var x= $('#totalCategory').val();
            
            $('.categoryTitle').bind('mouseenter',function() { 
                $('.catList').hide();              
               $(this).next('.catList').stop(true).show()
                         .animate(400,'easeOutBack').andSelf();
                 
            
            });
            var catdiv=$('.categoryTitle').next('.catList');
            $(catdiv).bind('mouseleave',function(){
                $(this).hide();
            });
        });*/
		
		$(document).ready(function() {
			$(".sub").mouseenter(function(){$(".drd").hide();
			$(".sub").css("background-color","");
			$(".sub").find("a").css("color","");
			$(".drdopen").addClass("dis0");
			$(this).find(".drd").show().css("background-color","#ee3145");
			$(this).css("background-color","");
			
			$(".drd").mouseenter(function(){$(this).parents(".sub").find(".drdopen").removeClass("dis0");
			$(this).parents(".sub").css("background-color","");
			
			$(this).parents(".sub").find("a").css("color","#069");
			$(this).parents(".sub").children(".main").find("a").css("color","#fff");
			$(".drdopen").css("z-index","11")})});
			$(".sub").mouseleave(function(){$(".drd").hide();$(this).css("background-color","");
			$(".drdopen").mouseleave(function(){$(this).addClass("dis0");
			$(this).parents(".sub").find("a").css("color","")})});
			$(".drdclose").click(function(){$(this).parents(".drdopen").addClass("dis0");
			$(this).parents(".sub").find("a").css("color","");
			$(this).parents(".sub").css("background-color","")});
		});
        </script>
    </body>
</html>